<!--
https://apifox.com/apidoc/shared-9e650053-2f82-44db-9361-67df9f4ed420/api-94669030
-->
<template>

</template>



<style scoped>

</style>
<script setup>
import Enum from "@/gamejs/Enum";
import Util from "@/gamejs/Util";
import {ref, onMounted, onBeforeUnmount, onUnmounted,watch,computed} from "vue";
import { useStore} from 'vuex';

let store = useStore();
let clsid=winApp.getClsId();

/*组件挂载完成后执行的函数；*/
onMounted(() => {
  console.log("GameData onMounted");
  //获取真实数据 打开
  setInitConfig();

  window.CefWebInstance = window.CefWebInstance || { register: function () { } };
  window.CefWebInstance.register('CallJsFunc', function (funcNname, param) {
    if (window[funcNname]) {
      window[funcNname](param)
    }
  })
  window.onMessage = windowMes;
});


onBeforeUnmount(() => {
  console.log('GameData onBeforeUnmount 销毁之前');

})
onUnmounted(() => {
  //卸载组件实例后调用,调用此钩子时,组件实例的所有指令都被解除绑定,所有事件侦听器都被移除,所有子组件实例被卸载。
  winApp.deleteNotification(clsid);
  console.log("GameData onUnmounted 卸载组件实例后  ",clsid);
});

function setInitConfig(){
  console.log("GameData setInitConfig");
  let telephone=Util.GetUrlParam('telephone');
  if(telephone=='')return;
  store.state.telephone=telephone;

  let uid = Util.GetUrlParam("account");
  store.state.userId=Util.GetUrlParam("account");

}

function windowMes(data) {
  let pct = Util.getAppType();
  if (pct === 0) {
    data = $Base64.decode(data);
    data = JSON.parse(data);
  }
  // console.log("window.windowMes ====OOOOOOOOOOOOOOOOO==== 数据 ",data);
  console.log(data.message_type)
  if (data.message_type === 1000) {//查询记录
    //store.state.anchorLuckyBaoVal = data.message.anchorLuckyBaoVal;
    //store.state.anchorLuckyBaoMax = data.message.anchorLuckyBaoMax;
  }
}

</script>
